import Vue from 'vue'
import Router from 'vue-router'

import login from '@/views/login/login'
import mainContent from '@/views/mainContent'
import treeExample from '@/views/tree/treeExample'
import tableExample from '@/views/table/tableExample'
import home from '@/views/home/home'
import Gmap from '@/views/map/Gmap'
import cesium from '@/views/cesium/cesium'

Vue.use(Router)

export default new Router({
  routes: [
    //  登录
    {
      path: '/',
      name: 'login',
      component: login,
    },
    //  主体组件
    {
      path: '/mainContent',
      name: 'mainContent',
      redirect: 'home', //  重定向
      component: mainContent,
      meta: { id: 0 },
      children: [
        {
          path: '/treeExample',
          name: 'treeExample',
          component: treeExample,
          meta: { id: 6 }
        },
        {
          path: '/tableExample',
          name: 'tableExample',
          component: tableExample,
          meta: { id: 5 }
        },{
          path: '/home',
          name: 'home',
          component: home,
          meta: { id: 1 }
        },{
          path: '/Gmap',
          name: 'Gmap',       
          component: Gmap,
          meta: { id: 2 }
        },{
          path: '/cesium',
          name: 'cesium',
          component: cesium,
          meta: { id: 3 }
        }
      ]
    }
  ]
})
